package Interface;

public class test {
    public static void main(String[] args) {
        //匿名对象使用----1
        Person boy1 = new Person(){
            @Override
            public void Study(){
                System.out.println("Hello World");
            }
        };
        boy1.Study();

        //匿名对象使用----2
        new Person(){
            @Override
            public void Study(){
                System.out.println("Hello World");
            }
        }.Study();

        Boy boy2 = new Boy("lixixi", 18);
        boy2.Study();
        boy2.play();
        boy2.play_computer();

        Boy boy3 = new Boy("lixixi", 18);

        System.out.println(boy2 == boy3);

        Girl girl = new Girl();
        girl.Study();
        girl.play();
        girl.play_computer();
    }
}
